﻿
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;

namespace EventBus.EntityFrameworkCore
{
    public static class EntityFrameworkContextExtensions
    {
        public static void AddScheduleMasterDb(this IServiceCollection services, IConfiguration configuration)
        {

            services.AddDbContext<EventBusDbContext>();
            var options = new DbContextOptions<EventBusDbContext>();
            using (var ctx = new EventBusDbContext(new DbContextOptions<EventBusDbContext>() { }))
            {
                ctx.Database.EnsureCreated();
            }
        }
    }
}
